<template>
	<view>
		<mescroll-uni @init="mescrollInit" @down="downCallback" @up="upCallback" :down="downOption" :up="upOption">
			<view class="amount_row flexRow" v-for="(item,key) in outList" :key="key">
				<view class="">
					<view class="amount_title">支付宝提现</view>
					<view class="amount_status" :class="{ amount_defeat: item.status=='提现失败', amount_success: item.status=='提现通过' }">{{item.status}}</view>
				</view>
				<view class="amount_right">
					<view class="amount_time">{{item.create_time}}</view>
					<view class="amount_number">{{item.num}}</view>
				</view>
			</view>
		</mescroll-uni>
		
	</view>
</template>

<script>
	import MescrollMixin from '@/components/mescroll-uni/mescroll-mixins.js';
	import request from '../../apiRequest/request.js'
	export default {
		mixins: [MescrollMixin],
		data() {
			return {
				outList: [],
				downOption: {
					use: true, // 是否启用下拉刷新; 默认true
					auto: true // 是否在初始化完毕之后自动执行下拉刷新的回调; 默认true
				},
				// 上拉加载的常用配置
				upOption: {
					use: true, // 是否启用上拉加载; 默认true
					auto: false // 是否在初始化完毕之后自动执行上拉加载的回调; 默认true
				},
			}
		},
		onLoad() {
			// request.amountOutList(1,10).then(res=>{
			// 	console.log(res.data)
			// 	this.outList = res.data.list
			// }).catch(err=>{
			// 	this.$unexpected(err)
			// })
		},
		methods: {
			downCallback() {
				this.mescroll.resetUpScroll();
			},
			
			async upCallback(page) {
				request.amountOutList(page.num,20).then(res=>{
					if(page.num==1) this.outList = [];
					this.outList = this.outList.concat(res.data.list)
					let hasNext =  res.data.list.length < 20? false:true;
					this.mescroll.endSuccess(this.outList.length,hasNext)
				}).catch(err=>{
					this.$unexpected(err)
				})
			}
		}
	}
</script>

<style>
.amount_row{
	height: 124rpx;
	width: 100%;
	border-bottom: 1rpx solid rgba(238,238,238,1);
	background:rgba(255,255,255,1);
	justify-content: space-between;
	align-items: center;
	padding: 0 39rpx;
	box-sizing: border-box;
}
.amount_title{
	font-size:28rpx;
	font-family:Source Han Sans SC;
	font-weight:500;
	color:rgba(51,51,51,1);
	line-height:28rpx;
	margin-bottom: 16rpx;
}
.amount_status{
	font-size:24rpx;
	font-family:Adobe Heiti Std;
	font-weight:normal;
	color:rgba(172,172,172,1);
	line-height:24rpx;
}
.amount_time{
	font-size:24rpx;
	font-family:Adobe Heiti Std;
	font-weight:normal;
	color:rgba(172,172,172,1);
	line-height:24rpx;
	margin-bottom: 22rpx;
}
.amount_number{
	font-size:28rpx;
	font-family:Source Han Sans SC;
	font-weight:500;
	color:rgba(67,67,67,1);
	line-height: 28rpx;
}
.amount_right{
	text-align: right;
}
.amount_success{
	color: #52C41A;
}
.amount_defeat{
	color: #F5222D;
}
</style>
